<!DOCTYPE html>
<html lang="ch-ZH">
<head>
	<#include "/plugin.ftl" >
	<link rel="stylesheet" href="/plugin/ztree/zTreeStyle.css" type="text/css">
	<script type="text/javascript" src="/plugin/ztree/jquery.ztree.all.min.js"></script>


	<title>系统部门管理</title>
</head>
<body>
	<div class="container-fluid">
		<div class="row bg-info">
			<div class="col-md-12">
				<h5 class="">系统设置 &gt; 认证管理 &gt; 部门管理</h5>
			</div>
		</div>
		<div id="alertbar" class="col-md-12">
			<div class="alert alert-warning col-md-4 col-md-offset-4" role="alert" style="display: none">
				<button type="button" class="close"><span aria-hidden="true">&times;</span></button>
				<strong class="title">提示：</strong>
				<span class="content">操作成功。</span>
			</div>
		</div>
		<div id="listbar" class="row" style="margin-top: 10px;">
			<div class="col-md-12">
				<button type="button" class="btn btn-primary add">创建新部门</button>
				<button type="button" class="btn btn-danger del">批量删除</button>
			</div>
		</div>
		<div class="row" style="margin-top: 4px;">
			<div class="col-md-12">
				<form id="formbar" class="form-inline">
					<div class="form-group">
						<label for="a0">部门类型</label>
						<select class="form-control" id="a0" name="type">
							<option value="">请选择类型...</option>
							<option value="0">行政部门</option>
							<option value="1">业务部门</option>
						</select>
					</div>
					<div class="form-group">
						<label for="a1">部门名称</label>
						<input type="text" class="form-control" id="a1" name="name">
					</div>
					<button type="button" class="btn btn-primary margin-left-20"
						name="refresh" onclick="$('#table').bootstrapTable('refresh');">查询</button>
					<button type="button" class="btn btn-info margin-left-20"
							name="refresh" onclick="formbar.reset();">重置</button>
				</form>
				<table id="table" class="table table-hover table-bordered"></table>
			</div>
		</div>
	</div>
	<div class="modal fade" id="addModal" tabindex="-1" role="dialog"
		aria-labelledby="addModalLabel">
		<div class="modal-dialog" style="width: 880px; height: 760px;">
			<div class="modal-content">
				<div class="modal-header">
					<button data-dismiss="modal" class="close" type="button">
						<span aria-hidden="true">×</span><span class="sr-only">Close</span>
					</button>
					<h4 class="modal-title">创建新部门</h4>
				</div>
				<div class="modal-body">
					<form id="addForm" class="form-horizontal" action="${dir}/add">
						<div class="row">
							<div class="form-group col-sm-6">
								<label class="col-sm-3 control-label">部门名称</label>
								<div class="col-sm-9">
									<input type="text" class="form-control" name="name"
										placeholder="部门名称">
								</div>
							</div>
							<div class="form-group col-sm-6">
								<label class="col-sm-3 control-label">部门类型</label>
								<div class="col-sm-9">
									<select class="form-control" name="type">
										<option value="0">行政</option>
										<option value="1">业务</option>
									</select>
								</div>
							</div>
						</div>
						<div class="row">
							<div class="form-group col-sm-6">
								<label class="col-sm-3 control-label">经理账号</label>
								<div class="col-sm-9">
									<input type="text" class="form-control" name="managerPhone" plcceholder="部门经理的手机号">
								</div>
							</div>
							<div class="form-group col-sm-6">
								<label class="col-sm-3 control-label">PID</label>
								<div class="col-sm-9">
									<input type="number" class="form-control" name="pid" value="1"
										   placeholder="上级部门ID">
								</div>
							</div>
						</div>
						<div class="row">
							<div class="form-group col-sm-11">
								<label class="col-sm-2 control-label" style="width: 13.4%">地址</label>
								<div class="col-sm-9" style="width: 84.4%">
									<input type="text" class="form-control" name="position"
										   placeholder="部门地址">
								</div>
							</div>
						</div>
						<div class="row">
							<div class="form-group col-sm-11">
								<label class="col-sm-2 control-label" style="width: 13.4%">备注</label>
								<div class="col-sm-9" style="width: 84.4%">
									<textarea class="form-control" name="description" placeholder="请输入备注信息..." style="resize: none" row="3"></textarea>
								</div>
							</div>
						</div>
						<div class="row">
							<div class="form-group">
								<div class="col-sm-offset-9 col-sm-3">
									<button data-dismiss="modal" class="btn btn-default"
										type="button">关闭</button>
									<button class="btn btn-primary" type="submit">提交</button>
									<input type="hidden" name="id" value="" />
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>

	<div id="viewModal" class="modal fade" tabindex="-1" role="dialog">
		<div class="modal-dialog" style="width: 880px; height: 760px;">
			<div class="modal-content">
				<div class="modal-header">
					<button data-dismiss="modal" class="close" type="button">
						<span aria-hidden="true">×</span><span class="sr-only">Close</span>
					</button>
					<h3 class="modal-title">查看部门详细信息</h3>
				</div>
				<div class="modal-body">
					<table id="viewTable" class="table table-bordered">
						<tbody>
						<tr>
							<th scope="row" class="col-sm-2">ID</th>
							<td id="view_id" class="col-sm-4"></td>
							<th class="col-sm-2">PID</th>
							<td id="view_pid"></td>
						</tr>
						<tr>
							<th scope="row">部门名称</th>
							<td id="view_name"></td>
							<th scope="row">部门类型</th>
							<td id="view_type"></td>
						</tr>
						<tr>
							<th scope="row">部门经理</th>
							<td id="view_managerName"></td>
							<th scope="row">经理账号</th>
							<td id="view_managerPhone"></td>
						</tr>
						<tr>
							<th scope="row">部门地址</th>
							<td id="view_position" colspan="3"></td>
						</tr>
						<tr>
							<th scope="row">创建时间</th>
							<td id="view_createTime"></td>
							<th scope="row">修改时间</th>
							<td id="view_updateTime"></td>
						</tr>
						<tr>
							<th scope="row">备注</th>
							<td id="view_description" colspan="3"></td>
						</tr>
						</tbody>
					</table>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-success" data-dismiss="modal">关闭</button>
				</div>
			</div>
		</div>
	</div>
	<!-- /.view model -->
	<div id="deleteModal" class="modal fade bs-example-modal-sm"
		tabindex="-1" role="dialog" aria-labelledby="">
		<div class="modal-dialog modal-sm" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button data-dismiss="modal" class="close" type="button">
						<span aria-hidden="true">×</span><span class="sr-only">Close</span>
					</button>
					<h5 class="modal-title">数据删除确认</h5>
				</div>
				<div class="modal-body">
					确认删除选的数据吗？<br>删除后无法恢复！
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
					<button type="button" class="btn btn-danger del">确认删除</button>
				</div>
			</div>
		</div>
	</div>
	<#include "/dir.ftl"/>
	<script type="text/javascript" src="${springMacroRequestContext.contextPath}/asset/system/auth/deptlist.js?v=${js_version}4"></script>
</body>
</html>
